<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:p="http://primefaces.org/ui"
	template="/templates/template_basic.xhtml">
	<ui:define name="title">
		#{msgs['home.title']}
	</ui:define>
	<ui:define name="content">
		<h:form id="formTrain">
			<p:growl id="messages" showDetail="true" sticky="true"
				autoUpdate="true" life="1" />
			<h:panelGrid id="panelControls" columns="3" width="100%">
				<h:panelGrid columns="1">
					<p:outputLabel value="#{msgs['train.controls.indexdocuments']}"/>
					<p:commandButton value="#{msgs['train.controls.index']}"
						actionListener="#{trainBean.index}"/>
					<p:outputLabel value=""/>
					<p:outputLabel value=""/>
					<p:outputLabel value=""/>
				</h:panelGrid>
				<h:panelGrid columns="1">
					<p:outputLabel value="#{msgs['train.controls.assessment.assessment']}"/>
					<p:outputLabel value="#{msgs['train.controls.assessment.selectalgs']}"/>
				    <p:selectManyButton value="#{trainBean.selectedAlgs}"
						label="#{msgs['train.controls.algs']}" panelStyle="width:220px">
						<f:selectItems value="#{trainBean.algs}" />
					</p:selectManyButton>
					<p:commandButton value="#{msgs['train.controls.assessment.assess']}"
						actionListener="#{trainBean.evaluate}"
						update="formTrain:panelCharts" />
				</h:panelGrid>
				<h:panelGrid columns="1">
					<p:outputLabel value="#{msgs['train.controls.training.training']}"/>
					<p:outputLabel value="#{msgs['train.controls.training.selectTrainAlg']}"/>
					<p:selectOneButton value="#{trainBean.selectedAlg}"
						label="#{msgs['train.controls.algs']}" panelStyle="width:220px">
						<f:selectItems value="#{trainBean.algs}" />
					</p:selectOneButton> 
					<p:commandButton value="#{msgs['train.controls.training.train']}"
						actionListener="#{trainBean.train}"/>
				</h:panelGrid>
			</h:panelGrid>
			<h:panelGrid id="panelCharts" columns="1">
				<p:pieChart id="pieChart" value="#{trainBean.pieModel}"
					title="#{msgs['train.controls.results']}" legendPosition="nw"
					style="width:400px;height:300px;" animate="true"
					showDataLabels="true" rendered="#{trainBean.singleAlg}" />
				<p:barChart id="basic" value="#{trainBean.categoryModel}"
					title="#{msgs['train.controls.results']}" legendPosition="ne"
					style="width:400px;" animate="true"
					min="0" max="100" rendered="#{trainBean.multiAlg}" />
			</h:panelGrid>
		</h:form>
	</ui:define>
</ui:composition>